#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    int a, i;
    char s[30] = "";
    scanf("%d", &a);
    i = 0;
    while (a)
    {
        s[i] = a % 10 + '0';
        a = a / 10;
        i++;
    }
    printf("%c", s[i--]);
    for (; i >= 0; i--)
    {

        if ((i + 1) % 3 == 0) 
            printf(",%c", s[i]);
        else
            printf("%c", s[i]);
    }

    return 0;
}
